import java.util.Scanner;
/**
 * This is the main Tic Tac Toe game class.
 * @author Andrei Kashin
 *
 */
public class Game1 {
	
	Scanner userInput = new Scanner(System.in);
	/**
	 * Standard main method
	 * @param args	standard command line args
	 */
	public static void main(String[] args) {
		
		// declare array of integers of game elements
		GameBoard board = new GameBoard();
		
		// print welcome message
		System.out.println("Hello\nThis is a game board.");
		System.out.println("+---+---+---+\n"
						 + "| 1 | 2 | 3 |\n"
						 + "+---+---+---+\n"
						 + "| 4 | 5 | 6 |\n"
						 + "+---+---+---+\n"
						 + "| 7 | 8 | 9 |\n"
						 + "+---+---+---+");

		// game iterations here
		while (!board.IsGameOver()) {
			board.HumanTurn();
			if (board.IsGameOver() == true) {
				System.out.println("Bye bye.");
				return;
			}
			board.CompTurn();
			board.CheckWinner();
			board.DrawBoard();
		}
		
		// game over
		String winner = board.CheckWinner();
		if (winner == "Computer") {
			System.out.println("Computer Won");
		}
		else if (winner == "Human") {
			System.out.println("You Won");
		}
		else {
			System.out.println("Game Drawn");
		}
	}
}